#ifndef  CAMERA_HPP
# define CAMERA_HPP

# include <SFML/Graphics.hpp>
# include "../container.hpp"

namespace Shiny
{
  namespace Applejack
  {
    class Body;
    class World;

    class View : public Widgets::Container
    {
    public:
      View(World& world);

      void          RenderSelf(void);
      void          SyncWithBody(const Body*, int, sf::Vector2f = sf::Vector2f(0.f, 0.f));
      void          SetSize(const sf::Vector2f&);

    private:
      void          DrawLandscape(void);
      void          Refresh(void);
      void          RefreshSync(sf::Vector2f, sf::Vector2f);
      
      World&        _world;
      sf::View      _view;
      const Body*   _sync;
      sf::Vector2f  _decalage;
      int           _cameraSpeed;
      sf::FloatRect _boundingBox;
      sf::Sprite    _landscape;
      sf::Vector2f  _landscapeTexSize;
    };
  }
}

#endif
